<!-- $Id: card_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->
{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js,jquery.min.js"}
<!-- start goods list -->
<form method="post" action="" name="listForm">
<input type="hidden" name="goods_id" value="{$goods_id}" />
<div class="list-div" id="listDiv">
{/if}
  <table cellpadding="3" cellspacing="1">
  <tr>
  	<th>
      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox">
      <a href="javascript:listTable.sort('card_id'); ">{$lang.record_id}</a>{$sort_card_id}
    </th>
    <th><a href="javascript:listTable.sort('card_name');">卡号</a>{$sort_card_name}</th>
    <th><a href="javascript:listTable.sort('card_fee');">卡值</a>{$sort_card_fee}</th>
    <th><a href="javascript:listTable.sort('sales_id');">业务员</a>{$sort_sales_id}</th>
    <th><a href="javascript:listTable.sort('issuing_id');">发卡人</a>{$sort_issuing_id}</th>
    <th><a href="javascript:listTable.sort('user_id');">使用者</a>{$sort_user_id}</th>
    <th>{$lang.handler}</th>
  </tr>
  { foreach from=$cardNum_list item=card}
  <tr>
  	<td align="center"><input type="checkbox" name="checkboxes[]" value="{$card.card_id}" />{$card.card_id}</td>
    <td align="center">{$card.card_name|escape:"html"}</td>
    <td align="center"><span onclick="listTable.edit(this, 'edit_card_fee', {$card.card_id})">{$card.card_fee}</span></td>
    <td align="center">{if $card.sales_name}{$card.sales_name}{else}N/A{/if}</td>
    <td align="center">{if $card.issuing_name}{$card.issuing_name}{else}N/A{/if}</td>
    <td align="center">{if $card.user_name}{$card.user_name}{else}N/A{/if}</td>
    <td align="center" nowrap="true" valign="top">
        <a href="?act=edit&amp;id={$card.card_id}" title="{$lang.edit}"><img src="images/icon_edit.gif" border="0" height="16" width="16"></a>
        <a href="javascript:;" onclick="listTable.remove({$card.card_id}, '你确认要删除这条记录吗？')" title="{$lang.remove}"><img src="images/icon_drop.gif" border="0" height="16" width="16"></a>
	</td>
  </tr>
    {foreachelse}
	<tr><td class="no-records" colspan="10">{$lang.no_records}</td></tr>
    {/foreach}
  </table>

  <table cellpadding="4" cellspacing="0">
    <tr>
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>
{if $full_page}
</div>

<div>
  <input type="hidden" name="act" value="batch" />
  <select name="type" id="selAction" onchange="rg_changeAction()">
    <option value="">{$lang.select_please}</option>
    <option value="trash">删除</option>
    <option value="move_tosales">移动到业务员</option>
    <option value="move_toissuing">移动到发卡人</option>
  </select>
  <select id="target_cat" name="target_cat" style="display:none">
    <option value="0">{$lang.select_please}</option>
  </select>
  <input type="submit" value="{$lang.button_submit}" id="btnSubmit" name="btnSubmit" class="button" disabled="true" />
</div>

</form>
<!-- end goods list -->
<script type="text/javascript" language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};
{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}

{literal}
onload = function(){
    startCheckOrder();
}

function rg_changeAction(){
	var selAction = $("#selAction").val();
	if(selAction == 'move_tosales'){
		Ajax.call('cardNum.php?act=load_user&rank_id=6','', get_sales, 'GET', 'JSON');
	}else if(selAction == 'move_toissuing'){
		Ajax.call('cardNum.php?act=load_user&rank_id=3','', get_issuing, 'GET', 'JSON');
	}else{
		$("#target_cat").hide();
	}
}
function get_sales(result){
	var sales = '<option value="0">请选择...</option>';
	$.each(result,function(i){
		sales += '<option value="'+result[i].user_id+'">'+result[i].user_name+'</option>';
	});
	$("#target_cat").html(sales).show();
}
function get_issuing(result){
	var issuing = '<option value="0">请选择...</option>';
	$.each(result,function(i){
		issuing += '<option value="'+result[i].user_id+'">'+result[i].user_name+'</option>';
	});
	$("#target_cat").html(issuing).show();
}

{/literal}
</script>
{include file="pagefooter.htm"}
{/if}